

# 216.组合总和III  之和为n的k个数

def main(n,k):
    result = []
    temp = []
    def backtrack(n,k,startIndex):
        sum = 0
        for i in range(0,len(temp)):
            sum = sum + temp[i]
        if sum==n and len(temp)==k:
            result.append(temp[:])
            return
        # if sum>n:
        #     return
        for i in range(startIndex,10):
            temp.append(i)
            backtrack(n,k,i+1)
            temp.pop()
    backtrack(n,k,1)
    return result

if __name__ == "__main__":
    n = int(input())
    k = int(input())
    result = main(n,k)
    print(result)
